Component({
    data:{
            tabbarArr:[{
                "pagePath":"/pages/index/index",
                "text":"首页",
                "icon":"home-o"
            },{
                "pagePath":"/pages/category/category",
                "text":"分类",
                "icon":"apps-o"
            },{
                "pagePath":"/pages/cart/cart",
                "text":"购物车",
                "icon":"cart-o"
            },{
                "pagePath":"/pages/user/index/index",
                "text":"我的",
                "icon":"user-o"
            },
        ],
            active:0
        },
        methods:{
            onChange(event){
                console.log(1);
                this.setData({
                    active:event.detail
                })
                wx.switchTab({
                  url: this.data.tabbarArr[event.detail].pagePath
                })
            }
        }

})
